﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

namespace twilters
{
    public class FilterLineItem : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        TweetField field;
        String content;
        MatchType matchType;

        public TweetField Field
        {
            get { return field; }

            set
            {
                if (value != this.field)
                {
                    this.field = value;
                    NotifyPropertyChanged("Field");
                }
            }
        }

        public MatchType MatchType
        {
            get { return matchType; }

            set
            {
                if (value != this.matchType)
                {
                    this.matchType = value;
                    NotifyPropertyChanged("MatchType");
                }
            }
        }

        public String Content
        {
            get { return content; }

            set
            {
                if (value != this.content)
                {
                    this.content = value;
                    NotifyPropertyChanged("Content");
                }
            }
        }

        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}
